<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>查询出院病人信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../layui/css/layui.css"  media="all">
</head>
<body style="text-align: center">
<style>
    .form{
        margin-top: 30px;
        margin-left:80px;
    }
    .left{
        margin-right: 200px;
    }
</style>

<!--<form class="layui-form layui-form-pane form" action="">-->

<div class="layui-form demoTable form">

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">住&nbsp;&nbsp;院&nbsp;&nbsp;号：</label>
            <div class="layui-input-inline">
                <input type="text" name="id" id="id" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</label>
            <div class="layui-input-inline">
                <input type="text" name="name" id="name" autocomplete="off" class="layui-input">
            </div>
        </div><br><br>
        <div class="layui-inline">
            <label class="layui-form-label">日期范围：</label>
            <div class="layui-input-inline">
                <input type="date" class="layui-input" name="beginTime" id="beginTime">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">-</label>
            <div class="layui-input-inline">
                <input type="date" class="layui-input" name="endTime" id="endTime">
            </div>
        </div><br>
    </div>
    <div class="layui-form-item left">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1" data-type="reload">搜索</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <button type="reset" class="layui-btn layui-btn-primary">清空条件</button>
        </div>
    </div>

</div>
<!--</form>-->

<table class="layui-hide" id="doctor" lay-filter="user"></table>


<script src="../layui/layui.js" charset="utf-8"></script>
<script src="../js/jquery-1.12.2.min.js"></script>

<script>
    layui.use(["form","table","layer","jquery","laydate"], function(){
        var form = layui.form,
            table = layui.table,
            layer = layui.layer,
            $ = layui.$
            laydate = layui.laydate;

        //方法级渲染
        table.render({
            elem: "#doctor"
            ,url: "/hospital/doctor/selectOutRecord.do"
            ,method:"post"
            ,cols: [[
                {field:'id', title: '住院号', width:80}
                ,{field:'userName', title: '姓名', width:80}
                ,{field:'doctorName', title: '主治医生', width:100}
                ,{field:'idNumber', title: '身份证号', width:250}
                ,{field:'inHospital', title: '入院时间',width:250}
                ,{field:'outHospital', title: '出院时间', width:250}
            ]]
            ,id: 'testReload'
            ,page: true
        });

        var $ = layui.$, active = {
            reload: function(){
                //执行重载
                table.reload('testReload', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                    ,where: {
                        id:$("#id").val(),
                        name: $("#name").val(),
                        beginTime:$("#beginTime").val(),
                        endTime:$("#endTime").val()
                    }
                });
            }
        };

        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });

</script>


</body>
</html>